package com.example.yuejian.Model;

import com.example.yuejian.Bean.LoginBean;
import com.example.yuejian.RetrofitListener;
import com.example.yuejian.Service.UserService;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by 释怀 on 2018/9/25.
 */

public class LoginModel extends RetrofitBaseModel {


        public Retrofit retiofit;
        private String BASEURL="yuejian/public/index.php/api/user/login/";
        private String IP= "http://172.19.163.68/" ;


    public LoginModel(){
             retiofit=new Retrofit.Builder()
                    .baseUrl(IP+BASEURL)
                    .addConverterFactory(GsonConverterFactory.create())
                    .build();

        }



    public void userLogin(String username,String password,final RetrofitListener listener){

        UserService Service=retiofit.create(UserService.class);
        Call<LoginBean> call= Service.getLogin(username,password );
        bindCallback(call,listener,1);
    }

}
